import 'package:wanxiang_app/generated/json/base/json_field.dart';
import 'package:wanxiang_app/generated/json/safe_entity.g.dart';
import 'dart:convert';
export 'package:wanxiang_app/generated/json/safe_entity.g.dart';

@JsonSerializable()
class SafeEntity {
	late int code;
	late String msg;
	late List<SafeData> data;

	SafeEntity();

	factory SafeEntity.fromJson(Map<String, dynamic> json) => $SafeEntityFromJson(json);

	Map<String, dynamic> toJson() => $SafeEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class SafeData {
	late int id;
	late String title;
	@JSONField(name: "img_url")
	late String imgUrl;

	SafeData();

	factory SafeData.fromJson(Map<String, dynamic> json) => $SafeDataFromJson(json);

	Map<String, dynamic> toJson() => $SafeDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}